package com.itheima.chapter09.io.charstream;
//字符流读数据

import java.io.FileReader;
import java.io.IOException;

public class InputStreamWriterDemo {
    public static void main(String[] args) throws IOException {
        FileReader fr =new FileReader("MyIdeaTest\\b.txt");
        //一次读一个数据
       /* int ch;
        while((ch=fr.read())!=-1){
            System.out.println((char)ch);
        }
        System.out.println("======================");*/
        //一次读多个数据
        char[] chars =new char[1024];
        int len;
        while((len=fr.read(chars))!=-1){
            System.out.println(new String(chars,0,len));
        }
        fr.close();
    }
}
